Skip to content

feat(dart): add TransformationOptions for ingestion transporter configuration#6321

Open
MarioAlexandruDan wants to merge 34 commits into
mainfrom
feat/dart-transformation-options
Open

feat(dart): add TransformationOptions for ingestion transporter configuration#6321
MarioAlexandruDan wants to merge 34 commits into
mainfrom
feat/dart-transformation-options

Conversation

@MarioAlexandruDan
Copy link
Copy Markdown
Contributor

@MarioAlexandruDan MarioAlexandruDan commented Apr 30, 2026

🧭 What and Why

Part of the effort to standardize transformationOptions across all 11 language SDKs. Depends on the JS + Foundation ticket for CTS infrastructure.

🎟 JIRA Ticket API-379:

Changes included:

  • TransformationOptions.ingestionClientOptions: ClientOptions?: Reuses Dart's existing general-purpose ClientOptions instead of duplicating 8 fields like other languages had to.
  • ClientOptions.transformationOptions: Stored on config so the client constructs in one shot, consistent with how all other Dart client options work.
  • Spec timeouts via RequestOptions in every execute() call: Constructor defaults get silently overridden by callers passing their own ClientOptions, request-level always wins.
  • import 'dart:io' as io: The ingestion spec generates a Platform model that shadows dart:io.Platform at import time.
  • lib/src/extension.dart placeholder in client_ingestion: lib.mustache unconditionally exports this file in every package barrel, missing it breaks the build.
  • DartCTSManager snake_case → camelCase: Ingestion spec uses snake_case; CTS generator passed raw names producing uncompilable Dart constructor calls.
  • param_object.mustache aggregates additionalProperties: Old template generated one entry per extra field; Dart forbids duplicate named args in a single call.
  • runCts.ts dart in both mock validators: replaceAllObjectsWithTransformation calls chunkedPush internally, hitting the pushMock server indirectly.

🧪 Test

- Add TransformationOptions to client_core
- Add transformationOptions field to ClientOptions
- Generate algolia_client_ingestion Dart package
- Add ingestion transporter wiring to SearchClient template
- Implement chunkedPush, saveObjectsWithTransformation,
  partialUpdateObjectsWithTransformation, and
  replaceAllObjectsWithTransformation extensions
- Update pubspec_overrides across docs/tests/playground
@MarioAlexandruDan MarioAlexandruDan self-assigned this Apr 30, 2026
@algolia-bot
Copy link
Copy Markdown
Collaborator

algolia-bot commented Apr 30, 2026

✔️ Code generated!

Name Link
🪓 Triggered by 280df70c0238a01d199fe4e241c313e28ca26baf
🍃 Generated commit ec782e5e6f66e7286f252a0ac1b0d62cad7bd6c8
🌲 Generated branch generated/feat/dart-transformation-options
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 2355
go 2096
php 1792
csharp 1543
python 1237
java 1154
ruby 947
swift 352
scala 23

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 30, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

TIP This summary will be updated as you push new changes.

@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from b15c29b to 44910b3 Compare May 12, 2026 13:04
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from a7ec108 to ee6ec15 Compare May 12, 2026 13:51
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from d1bdb33 to 026e618 Compare May 12, 2026 14:15
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 13, 2026 13:07
@MarioAlexandruDan MarioAlexandruDan requested a review from a team as a code owner May 13, 2026 13:07
@MarioAlexandruDan MarioAlexandruDan requested a review from Fluf22 May 13, 2026 13:07
Copy link
Copy Markdown
Collaborator

@Fluf22 Fluf22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the changes you made around server timeouts, I might be missing something

Comment thread templates/dart/api.mustache Outdated
Comment on lines +224 to +227
) + {{/vendorExtensions.x-timeouts}}{{^vendorExtensions.x-timeouts}}RequestOptions(
writeTimeout: Duration(milliseconds: {{{serverWriteTimeout}}}),
readTimeout: Duration(milliseconds: {{{serverReadTimeout}}}),
connectTimeout: Duration(milliseconds: {{{serverConnectTimeout}}}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand why you added that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added inline comment for better understanding

…own defaults, remove unexplained server-timeout fallback
@MarioAlexandruDan MarioAlexandruDan marked this pull request as draft May 18, 2026 07:55
…ut per-endpoint x-timeouts

Also fix Docker build: strip +10 build suffix from java-version since SDKman only accepts 21.0.11-zulu
@MarioAlexandruDan
Copy link
Copy Markdown
Contributor Author

The default is 100 now, and we want to pass maxRetries from the calling method I believe (check Dart jira ticket for maxRetries update)

Related PR: configurable retries on chunked helpers via ChunkedHelperOptions:
#6405

@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 18, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants